﻿@{
    ViewBag.Title = "上传限制";
    Layout = "~/Views/Shared/_ListLayout.cshtml";
}
@inherits CMSWebViewPage<object>

<div id="toolbar_uploadlimit" class="datagrid-toolbar">
    @CurrentButtonTool.Create()
    <div>
        <form id="fr_search_uploadlimit">
            @Html.QueryStringBox("名称", "Name")
            @Html.QueryStringBox("资源类型", "UcCode")
            @Html.QueryStringBox("限制类型", "LimitCode")
            <a href="javascript:void(0)" onclick="Search();" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true">Search</a>
        </form>
    </div>
</div>
<table id="dg_uploadlimit" data-options="url:'/uploadlimit/listjson?ucid=@TransferID',border:false,fit:true,fitColumns:true,toolbar:'#toolbar_uploadlimit',singleSelect:true,pagination:true,pageSize:20">
    <thead>
        <tr>
            <th data-options="field:'ck',checkbox:true"></th>
            <th data-options="field:'Id',width:40,align:'center'">Id</th>
            <th data-options="field:'Name',width:40,align:'center'">名称</th>
            <th data-options="field:'MediaType',width:40,align:'center',formatter:FormatMediaType">媒体类型</th>
            <th data-options="field:'UcCode',width:80,align:'center'">资源类型</th>
            <th data-options="field:'LimitCode',width:80,align:'center'">限制类型</th>
            <th data-options="field:'SaveType',width:80,align:'center',formatter:FormatSaveType">保存方式</th>
            <th data-options="field:'LimitSize',width:80,align:'center'">限制大小(K)</th>
            <th data-options="field:'LimitExtension',align:'center'">文件扩展名</th>
        </tr>
    </thead>
</table>
@section Bottom{
    <script type="text/javascript">
        var objBizDatagrid = new BizDatagrid('#dg_uploadlimit');
        function Add() {
            objBizDatagrid.add("/uploadlimit/editpage");
        }
        function Back() {
            window.location.href = "/uploadcategory";
        }
        function Edit() {
            objBizDatagrid.edit("/uploadlimit/editpage");
        }
        function Search() {
            objBizDatagrid.search('#fr_search_uploadlimit', '/uploadlimit/listjson?ucid=@TransferID');
        }
        function Delete() {
            objBizDatagrid.del('/uploadlimit/delete');
        }
        function FormatMediaType(val) {
            switch (val) {
                case 0:
                    return "图片";
                case 1:
                    return "文件";
                default:
                    return "未知";
            }
        }
        function FormatSaveType(val) {
            switch (val) {
                case 0:
                    return "本地服务器";
                case 1:
                    return "远程服务器";
                case 2:
                    return "云存储";
                default:
                    return "未知";
            }
        }
    </script>
}
